var form={
		onbeforeSubmit:function(formId){
			var onbeforeSubmit=$("#"+formId).attr("onbeforeSubmit");
			if(onbeforeSubmit&&onbeforeSubmit!=""){
				return eval(onbeforeSubmit);
			}
			return true;
		},
		isPageParam:function(formId){
			if($("#"+formId).find(":input[name=pageNumber]").length==0){
				$("#"+formId).append("<input type='hidden' name='pageNumber'>");
			}
			if($("#"+formId).find(":input[name=pageSize]").length==0){
				$("#"+formId).append("<input type='hidden' name='pageSize'>");
			}
		},
		previous:function(formId,pageNumber,pageSize){
			if(this.onbeforeSubmit(formId)){
				this.isPageParam(formId);
				$("#" + formId).find(":input[name=pageNumber]").val(pageNumber-1);
				$("#" + formId).find(":input[name=pageSize]").val(pageSize);
				$("#" + formId).submit();
			}
		},
		next:function(formId,pageNumber,pageSize){
			if(this.onbeforeSubmit(formId)){
				this.isPageParam(formId);
				$("#" + formId).find(":input[name=pageNumber]").val(pageNumber+1);
				$("#" + formId).find(":input[name=pageSize]").val(pageSize);
				$("#" + formId).submit();
			}
		},
		toPage:function(formId, pageNumber,pageSize){
			if(this.onbeforeSubmit(formId)){
				this.isPageParam(formId);
				$("#" + formId).find(":input[name=pageNumber]").val(pageNumber);
				$("#" + formId).find(":input[name=pageSize]").val(pageSize);
				$("#" + formId).submit();
			}
		},
		search:function(formId){
			if(this.onbeforeSubmit(formId)){
				$("#" + formId).find(":input[name=pageNumber]").val(1);
				$("#" + formId).submit();
			}
		},
		doSumbit:function(formId){
			if(this.onbeforeSubmit(formId)){
				$("#" + formId).submit();
			}
		}
}
$(function(){
	
	if($('.date-picker').length>0){
		if($('.date-picker').datepicker){
			$('.date-picker').datepicker({
		        rtl: App.isRTL(),
		        language: 'zh-CN',
		        format:'yyyy-mm-dd',
		        orientation: "left",
		        autoclose: true,
		        todayBtn:"linked"
		    });
		}
	}
	
	
});